WriteMetadataFileUnit Subroutine

private subroutine WriteMetadataFileUnit(network, fileunit)

write metadata section to open file unit TODO: full CRS support

Arguments

Type IntentOptional Attributes Name
type(ObservationalNetwork), intent(in) :: network
integer(kind=short), intent(in) :: fileunit

Variables

Type Visibility Attributes Name Initial
integer(kind=short), public :: i
integer(kind=short), public :: j

Source Code

SUBROUTINE WriteMetadataFileUnit &
!
(network, fileunit)

IMPLICIT NONE

! Arguments with intent(in):
TYPE (ObservationalNetwork), INTENT(IN) :: network
INTEGER (KIND = short), INTENT(IN) :: fileunit

!local declarations:
INTEGER (KIND = short) :: i, j
!----------------------------end of declarations-------------------------------

WRITE(fileunit,'(a)') 'description = '// TRIM (network % description) 
WRITE(fileunit,'(a)') 'unit = ' // TRIM (network % unit)
WRITE(fileunit,'(a)') 'epsg = ' // ToString (network % epsg)
WRITE(fileunit,'(a, i8)') 'count = ', network % countObs
WRITE(fileunit,'(a, i10)') 'dt = ', network % timeIncrement
WRITE(fileunit,'(a, f10.3)') 'missing-data = ', network % nodata
WRITE(fileunit,'(a, f10.3)') 'offsetz = ', network % offsetZ

WRITE(fileunit,*) !leave one blank line 
WRITE(fileunit,'(a)') 'metadata'
DO i = 1, network % countObs
	WRITE(fileunit,'(a," ",a," ",f12.2," ",f12.2," ",f12.2)') &
	      TRIM ( network % obs (i) % name ), &
	      TRIM ( network % obs (i) % id ), &
	      network % obs (i) % xyz % easting ,&
	      network % obs (i) % xyz % northing ,&
	      network % obs (i) % xyz % elevation
END DO

RETURN
END SUBROUTINE WriteMetadataFileUnit